#!/bin/bash
source /etc/profile;
i=100
pro_log_path="/web/sangong/publish/sg.log";
dateStr=$(date "+%Y-%m-%d %H:%M:%S")
dateStr=${dateStr// /_}
pro_log_path_back="/web/sangong/publish/log/sg-${dateStr}.log";
cp  ${pro_log_path} ${pro_log_path_back};

for ((i=0;i<=100;i+=2))
do
sleep 1s;
if grep -w "Tomcat started on port(s): 8080"   ${pro_log_path}; 
then break;
fi;

done
echo "start finished"
